package com.usian.comment.controller.v1

import com.usian.apis.comment.CommentRepayControllerApi
import com.usian.comment.service.CommentRepayService
import com.usian.model.comment.dtos.CommentRepayDto
import com.usian.model.comment.dtos.CommentRepayLikeDto
import com.usian.model.comment.dtos.CommentRepaySaveDto
import com.usian.model.common.dtos.ResponseResult
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/api/v1/comment_repay")
class CommentRepayController :CommentRepayControllerApi{
    @Autowired
    lateinit var commentRepayService: CommentRepayService

    @PostMapping("/load")
    override fun loadCommentRepay(@RequestBody dto: CommentRepayDto): ResponseResult<*> {
       return commentRepayService.loadCommentRepay(dto)
    }

    @PostMapping("/save")
    override fun saveCommentRepay(@RequestBody dto: CommentRepaySaveDto): ResponseResult<*> {
        return commentRepayService.saveCommentRepay(dto)
    }
    @PostMapping("/like")
    override fun saveCommentRepayLike(@RequestBody dto: CommentRepayLikeDto): ResponseResult<*> {
        return commentRepayService.saveCommentRepayLike(dto)
    }
}